package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouXsckMapper;
import com.ruoyi.system.domain.SysYongyouXsck;
import com.ruoyi.system.service.ISysYongyouXsckService;

/**
 * 销售出库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouXsckServiceImpl implements ISysYongyouXsckService 
{
    @Autowired
    private SysYongyouXsckMapper sysYongyouXsckMapper;

    /**
     * 查询销售出库
     * 
     * @param vouchdate 销售出库主键
     * @return 销售出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouXsck selectSysYongyouXsckByVouchdate(String vouchdate)
    {
        return sysYongyouXsckMapper.selectSysYongyouXsckByVouchdate(vouchdate);
    }

    /**
     * 查询销售出库列表
     * 
     * @param sysYongyouXsck 销售出库
     * @return 销售出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouXsck> selectSysYongyouXsckList(SysYongyouXsck sysYongyouXsck)
    {
        return sysYongyouXsckMapper.selectSysYongyouXsckList(sysYongyouXsck);
    }

    /**
     * 新增销售出库
     * 
     * @param sysYongyouXsck 销售出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouXsck(SysYongyouXsck sysYongyouXsck)
    {
        return sysYongyouXsckMapper.insertSysYongyouXsck(sysYongyouXsck);
    }

    /**
     * 修改销售出库
     * 
     * @param sysYongyouXsck 销售出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouXsck(SysYongyouXsck sysYongyouXsck)
    {
        return sysYongyouXsckMapper.updateSysYongyouXsck(sysYongyouXsck);
    }

    /**
     * 批量删除销售出库
     * 
     * @param vouchdates 需要删除的销售出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouXsckByVouchdates(String[] vouchdates)
    {
        return sysYongyouXsckMapper.deleteSysYongyouXsckByVouchdates(vouchdates);
    }

    /**
     * 删除销售出库信息
     * 
     * @param vouchdate 销售出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouXsckByVouchdate(String vouchdate)
    {
        return sysYongyouXsckMapper.deleteSysYongyouXsckByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteByDateRange(String startDate)
    {
        return sysYongyouXsckMapper.deleteByDateRange(startDate);
    }
}
